﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace YnPlcDataServer.Entities
{
    /// <summary>状态变量历史数据表</summary>
    public class YnSvData
    {
        /// <summary>数据id</summary>
        public long data_id { get; set; }
        /// <summary>采集器id</summary>
        public int svid_id { get; set; }
        /// <summary>创建时间</summary>
        public DateTime createTime { get; set; }
        /// <summary>值</summary>
        public string value { get; set; }

        //复制变量
        public YnSvid ynSvid { get; set; }
        public string svid_name
        {
            get
            {
                if (ynSvid != null)
                    return ynSvid.name;
                return "";
            }
        }

        public YnSvData()
        {
        }
        public YnSvData(int svid_id,string value)
        {
            this.svid_id = svid_id;
            this.value = value;
        }

    }
}
